﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using QuanLyDoanVien.Bussiness;
using QuanLyDoanVien.Controller;

namespace QuanLyDoanVien.Report
{
    public partial class frmHoatDongHocSinh : DevComponents.DotNetBar.Office2007Form
    {
        public frmHoatDongHocSinh()
        {
            InitializeComponent();
        }
        #region Biến
   
        DataTable dsHDHS = new DataTable();
        
        List<HoatDongInfo> dsHD = new List<HoatDongInfo>();
        HoatDongCtrl m_HoatDongCtrl = new HoatDongCtrl();
        HoatDongHocSinhCtrl m_HoatDongHSCtrl = new HoatDongHocSinhCtrl();
        List<LopInfo> ds_lop = new List<LopInfo>();
        LopCtrl m_LopCtrl = new LopCtrl();
        #endregion
        #region Hàm
      
        private void loadDSHoatDong()
        {
            dsHD = m_HoatDongCtrl.layDSHoatDong();
            combHoatDong.DisplayMember = "TenHoatDong";
            combHoatDong.ValueMember = "MaHoatDong";
            combHoatDong.DataSource = dsHD;
           
        }

        private void loadDSPhanCongHD()
        {
            if (combHoatDong.SelectedIndex >= 0)
            {
                dsHDHS = m_HoatDongHSCtrl.layHoatDongHocSinh1(combHoatDong.SelectedValue.ToString());
                PhanCongHoatDongBindingSource.DataSource = dsHDHS;
                this.reportViewer1.RefreshReport();
            }
        }

        #endregion
        private void frmHoatDongHocSinh_Load(object sender, EventArgs e)
        {

          
            loadDSHoatDong();
            loadDSPhanCongHD();
        }

        private void btnTruyXuat_Click(object sender, EventArgs e)
        {
            loadDSPhanCongHD();
        }
    }
}